// --------------------------------------------------------------------------------------------------------------------
// <copyright file="PublishingPageFieldsInfo.cs" company="Collaboris Ltd.">
//   Copyright (c) Collaboris Ltd. All rights Reserved.
// </copyright>
// <summary>
//   Defines the PublishingPageFieldsInfo
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Collaboris.Saf.Actions.Moss.Entities
{
    using System;

    using Microsoft.SharePoint;

    using SharePoint.Wss.Attributes;
    using SharePoint.Wss.Entities;

    using Utils;

    [Serializable]
    [CollaborisClass(
        Title = "Publishing Page Fields Information",
        ReleaseStatus = ReleaseStatus.Development,
        Summary = "Defines a page fields information." 
        )
    ]
    public class PublishingPageFieldsInfo : WSSEntityBase
    {
        private string pageRelativeUrl;
        private SerializableObjectDictionary<string> fields;

        [CollaborisProperty(
            Summary = "Specifies the relative URL of the page in the web.",
            Title = "Page Relative Url",
            Example = @"Pages/Default.aspx",
            InputHint = InputHint.SingleText,
            Required = true)]
        public string PageRelativeUrl
        {
            get
            {
                return this.pageRelativeUrl;
            }
            set
            {
                this.pageRelativeUrl = value;
            }
        }

        [CollaborisProperty(
            Summary = "Page fields collection.",
            Title = "Page fields",
            Example = @"<dictionary> " +
                        @"<entry key=""Description"" value=""Some Description"" />" +
                        @"<entry key=""Scheduling Start Date"">" +
                          @"<value type=""date"">10/10/2015 12:12:00</value>" +
                        @"</entry>" +
                        @"<entry key=""Page Content"">" +
                          @"<value type=""string"">Collaboris Image : &lt;img src=""http://www.collaboris.co.uk/App_Themes/CollaborisWeb/Images/Logo4.jpg""></value>" +
                        @"</entry>" +
                     @"</dictionary>",
            SerializedExample = @"<Dictionary type=""Collaboris.Utils.SerializableObjectDictionary`1[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"">
                              <item type=""System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"">
                                <key>
                                  <string>StringKey1</string>
                                </key>
                                <value>
                                  <string>AStringValue</string>
                                </value>
                              </item>
                              <item type=""System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"">
                                <key>
                                  <string>IntKey1</string>
                                </key>
                                <value>
                                  <int>3</int>
                                </value>
                              </item>
                              <item type=""System.Collections.Generic.List`1[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"">
                                <key>
                                  <string>ListKey1</string>
                                </key>
                                <value>
                                  <ArrayOfString xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
                                    <string>string 1</string>
                                    <string>string 2</string>
                                  </ArrayOfString>
                                </value>
                              </item>
                            </Dictionary>", 
            InputHint = InputHint.ObjectCollection,
            Required = true)]
        public SerializableObjectDictionary<string> Fields
        {
            get
            {
                
                return fields;
            }
            set
            {
                fields = value;
            }
        }
    }
}   